Skip to content

Add multi-select drag & drop support for objectMultihref condition lists#2960

Merged
dpfaffenbauer merged 3 commits into4.1from
copilot/add-drag-and-drop-support-again
Jan 29, 2026
Merged

Add multi-select drag & drop support for objectMultihref condition lists#2960
dpfaffenbauer merged 3 commits into4.1from
copilot/add-drag-and-drop-support-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

  • Understand the issue: Drag & drop in condition lists only handles single item instead of multiple selected data objects
  • Identify the affected file: src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/object/objectMultihref.js
  • Identify the root cause: onNodeDrop handler only processes data.records[0] instead of all records
  • Fix the onNodeDrop and onNodeOver handlers to support multiple records
    • Modified onNodeOver to check if ANY of the dragged records can be dropped
    • Modified onNodeDrop to iterate through all records and add each valid one
    • Used strict equality operators (===, !==) per code review feedback
    • Refactored to use for-of loops per code review feedback
  • Run code review - addressed feedback to use strict equality operators
  • Run CodeQL security check - no issues found
  • Verify JavaScript syntax is valid
Original prompt

This section details on the original issue you should resolve

<issue_title>Drag & Drop in Condition Lists</issue_title>
<issue_description>Problem Statement
In conditions such as quantity in cart price rules, it is not possible to drag multiple selected data objects into the condition list at once.

Description

  • Instead of dragging multiple selected objects together,
    each data object must be added individually to the condition list.

Impact

  • Significant additional effort when maintaining conditions.
  • Poor usability for complex rule configurations.

Mitigation

  • Implement drag & drop support for multiple data objects into lists.

@raphael-kat @papillo-solutions</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Modified objectMultihref.js to iterate through all selected records in
data.records instead of only processing the first record. This enables
users to select multiple data objects (products, categories, customers,
etc.) and drag them all at once into condition lists.

Fixes the issue where each data object had to be added individually to
condition lists in cart price rules, product price rules, shipping rules,
and other rule configurations.

Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add drag and drop support for condition lists Add multi-select drag & drop support for objectMultihref condition lists Jan 29, 2026
Copilot AI requested a review from dpfaffenbauer January 29, 2026 11:49
} else {
return Ext.dd.DropZone.prototype.dropNotAllowed;
// Check if any of the records can be dropped
for (var i = 0; i < data.records.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Expected a for-of loop instead of a for loop with this simple iteration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use for-of loop in dbfac39.

type: data.className
};
// Process all records in the drag selection
for (var i = 0; i < data.records.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Expected a for-of loop instead of a for loop with this simple iteration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use for-of loop in dbfac39.

Address code review feedback to use for-of loops for simpler iteration
over data.records arrays in both onNodeOver and onNodeDrop handlers.

Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
@sonarqubecloud
Copy link

@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@dpfaffenbauer dpfaffenbauer marked this pull request as ready for review January 29, 2026 19:18
@dpfaffenbauer dpfaffenbauer merged commit 1c7cd94 into 4.1 Jan 29, 2026
90 of 91 checks passed
@dpfaffenbauer dpfaffenbauer deleted the copilot/add-drag-and-drop-support-again branch January 29, 2026 19:33
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants